package com.concerneyes.health.adapter;

import android.content.Context;
import android.graphics.drawable.Drawable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;


import com.concerneyes.R;
import com.concerneyes.mine.model.MyGlassManModel;

import java.util.ArrayList;
import java.util.List;

import util.ActivityUtil;

public class HealthDailogAdapter extends BaseAdapter {
    private Context context;
    private List<MyGlassManModel> itemList;

    public HealthDailogAdapter(Context context, List<MyGlassManModel> itemList) {
        this.context = context;
        this.itemList = itemList;
    }

    @Override
    public int getCount() {
        return itemList.size();
    }

    @Override
    public MyGlassManModel getItem(int position) {
        return itemList.get(position);
    }

    @Override
    public long getItemId(int position) {
        return position;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        if (convertView == null) {
            convertView = LayoutInflater.from(parent.getContext()).inflate(R.layout.health_dialog_item, null, false);
        }
        TextView text1 = (TextView) convertView.findViewById(R.id.tv);
        ImageView iv = (ImageView) convertView.findViewById(R.id.iv);
        if (position == 0) {
            iv.setVisibility(View.VISIBLE);
        } else {
            iv.setVisibility(View.INVISIBLE);
        }
        text1.setText(itemList.get(position).getRealName());


        return convertView;
    }

}
